import Mock from 'mockjs';
// import mapJson1 from '../../public/map/420112.json'
// import mapJson2 from '../../public/map/420000.json'

Mock.setup({
  timeout: '300-600'
});
//获取当前健康度
Mock.mock('http://127.0.0.1:8081/holographic/selectListRealTime', 'get', () => {
  return {
    code: 200,
    data: { healthScore: 98 }
  }
})
//全息健康度
Mock.mock('http://127.0.0.1:8081/holographic/selectListByGroup', 'get', () => {
  return {
    code: 200,
    data: [
      {
        "code": "420000",
        "diagtime": "2021-04-01",
        "health": 65
      },
      {
        "code": "420000",
        "diagtime": "2021-04-02",
        "health": 34
      },
      {
        "code": "420000",
        "diagtime": "2021-04-03",
        "health": 67
      },
      {
        "code": "420000",
        "diagtime": "2021-04-04",
        "health": 17
      },
      {
        "code": "420000",
        "diagtime": "2021-04-05",
        "health": 34
      },
      {
        "code": "420000",
        "diagtime": "2021-04-06",
        "health": 67
      },
      {
        "code": "420000",
        "diagtime": "2021-04-07",
        "health": 12
      },
      {
        "code": "420000",
        "diagtime": "2021-04-08",
        "health": 78
      },
      {
        "code": "420000",
        "diagtime": "2021-04-09",
        "health": 34
      },
      {
        "code": "420000",
        "diagtime": "2021-04-10",
        "health": 56
      },
      {
        "code": "420000",
        "diagtime": "2021-04-11",
        "health": 32
      },
      {
        "code": "420000",
        "diagtime": "2021-04-12",
        "health": 88
      },
    ]
  }
})
//获取系统中存在的警告
Mock.mock('http://127.0.0.1:8081/alarm/selectListAllAlarm', 'get', () => {
  return {
    code: 200,
    data: [
    {
      "diagtime": "2021-04-06 11:20:30",
      "name": "采集设备A",
      "health": 0,
      "threshold": 60,
      "object": "历史视频质量C2"
    },
    {
      "diagtime": "2021-04-06 03:40:54",
      "name": "采集设备A",
      "health": 0,
      "threshold": 60,
      "object": "历史视频质量C2"
    },
    {
      "diagtime": "2021-04-06 11:20:30",
      "name": "基础设施B",
      "health": 0,
      "threshold": 60,
      "object": "历史视频质量C2"
    },
    {
      "diagtime": "2021-04-06 03:40:54",
      "name": "基础设施B",
      "health": 0,
      "threshold": 60,
      "object": "历史视频质量C2"
    },
    {
      "diagtime": "2021-04-06 11:20:30",
      "name": "核心数据C",
      "health": 0,
      "threshold": 60,
      "object": "历史视频质量C2"
    },
    {
      "diagtime": "2021-04-06 03:40:54",
      "name": "核心数据C",
      "health": 0,
      "threshold": 60,
      "object": "历史视频质量C2"
    },
    {
      "diagtime": "2021-04-06 11:20:30",
      "name": "服务资源D",
      "health": 0,
      "threshold": 60,
      "object": "历史视频质量C2"
    },
    {
      "diagtime": "2021-04-06 03:40:54",
      "name": "服务资源D",
      "health": 0,
      "threshold": 60,
      "object": "历史视频质量C2"
    },
    {
      "diagtime": "2021-04-06 11:20:30",
      "name": "应用平台E",
      "health": 0,
      "threshold": 60,
      "object": "历史视频质量C2"
    },
    {
      "diagtime": "2021-04-06 03:40:54",
      "name": "应用平台E",
      "health": 0,
      "threshold": 60,
      "object": "历史视频质量C2"
    },
    {
      "diagtime": "2021-04-06 11:20:31",
      "name": "核心数据C",
      "health": 0,
      "threshold": 42,
      "object": ""
    },
    {
      "diagtime": "2021-04-06 03:40:54",
      "name": "核心数据C",
      "health": 0,
      "threshold": 42,
      "object": ""
    },
    {
      "name": "视频图像信息解析系统2",
      "health": 32,
      "threshold": 60,
      "object": "解析系统3"
    }
  ]
  }
})
//当前分层健康度
Mock.mock('http://127.0.0.1:8081/level/selectListNow', 'get', () => {
  return {
    code:200,
    data:[
    {
      "diagtime": "2021-04-05 15:16:57",
      "name": "基础设施B",
      "health": 78
    },
    {
      "diagtime": "2021-04-05 20:16:57",
      "name": "服务资源D",
      "health": 87
    },
    {
      "diagtime": "2021-04-05 21:16:57",
      "name": "应用平台E",
      "health": 76
    },
    {
      "diagtime": "2021-04-05 21:46:57",
      "name": "采集设备A",
      "health": 54
    },
    {
      "diagtime": "2021-04-05 23:16:57",
      "name": "核心数据C",
      "health": 21
    }
  ]
  }
})
//历史分层健康度
Mock.mock('http://127.0.0.1:8081/level/selectListByGroup', 'get', () => {
  return {
    code:200,
    data:{
    "应用平台E": [
      {
        "month": "2021-03",
        "name": "应用平台E",
        "health": 76
      },
      {
        "month": "2021-04",
        "name": "应用平台E",
        "health": 23
      },
      {
        "month": "2021-05",
        "name": "应用平台E",
        "health": 34
      },
      {
        "month": "2021-06",
        "name": "应用平台E",
        "health": 78
      },
      {
        "month": "2021-07",
        "name": "应用平台E",
        "health": 12
      },
    ],
    "核心数据C": [
      {
        "month": "2021-03",
        "name": "核心数据C",
        "health": 13
      },
      {
        "month": "2021-04",
        "name": "核心数据C",
        "health": 35
      },
      {
        "month": "2021-05",
        "name": "核心数据C",
        "health": 47
      },
      {
        "month": "2021-06",
        "name": "核心数据C",
        "health": 89
      },
      {
        "month": "2021-07",
        "name": "核心数据C",
        "health": 54
      },
    ],
    "采集设备A": [
      {
        "month": "2021-03",
        "name": "采集设备A",
        "health": 23
      },
      {
        "month": "2021-04",
        "name": "采集设备A",
        "health": 34
      },
      {
        "month": "2021-05",
        "name": "采集设备A",
        "health": 12
      },
      {
        "month": "2021-06",
        "name": "采集设备A",
        "health": 89
      },
      {
        "month": "2021-07",
        "name": "采集设备A",
        "health": 54
      },
    ],
    "基础设施B": [
      {
        "month": "2021-03",
        "name": "基础设施B",
        "health": 12
      },
      {
        "month": "2021-04",
        "name": "基础设施B",
        "health": 89
      },
      {
        "month": "2021-05",
        "name": "基础设施B",
        "health": 32
      },
      {
        "month": "2021-06",
        "name": "基础设施B",
        "health": 67
      },
      {
        "month": "2021-07",
        "name": "基础设施B",
        "health": 98
      },
    ],
    "服务资源D": [
      {
        "month": "2021-03",
        "name": "服务资源D",
        "health": 17
      },
      {
        "month": "2021-04",
        "name": "服务资源D",
        "health": 54
      },
      {
        "month": "2021-05",
        "name": "服务资源D",
        "health": 98
      },
      {
        "month": "2021-06",
        "name": "服务资源D",
        "health": 34
      },
      {
        "month": "2021-07",
        "name": "服务资源D",
        "health": 65
      },
    ]
  }
  }
})
//获取地图数据以及排序数据
Mock.mock('http://127.0.0.1:8081/holographic/selectHealthByCode', 'get', () => {
  return {
    code:200,
    data:[
    { name: "江夏区", health: 20 },
    { name: "蔡甸区", health: 154 },
    { name: "黄陂区", health: 31 },
    { name: "新洲区", health: 69 },
    { name: "油尖旺", health: 44 },
    { name: "深水埗", health: 40 },
    { name: "汉南区", health: 37 },
    { name: "东西湖区", health: 45 },
    { name: "洪山区", health: 55 },
    { name: "汉阳区", health: 219 },
    { name: "江岸区", health: 49 },
    { name: "武昌区", health: 58 },
    { name: "青山区", health: 41 },
    { name: "江汉区", health: 22 },
    { name: "硚口区", health: 21 },

    { name: "十堰市", health: 20 },
    { name: "神农架林区", health: 154 },
    { name: "恩施土家族苗族自治州", health: 31 },
    { name: "宜昌市", health: 69 },
    { name: "襄阳市", health: 44 },
    { name: "荆门市", health: 40 },
    { name: "荆州市", health: 37 },
    { name: "孝感市", health: 45 },
    { name: "随州市", health: 45 },
    { name: "天门市", health: 55 },
    { name: "潜江市", health: 219 },
    { name: "仙桃市", health: 49 },
    { name: "武汉市", health: 58 },
    { name: "黄冈市", health: 41 },
    { name: "鄂州市", health: 22 },
    { name: "咸宁市", health: 21 },
    { name: "黄石市", health: 21 },

    { name: "张湾区", health: 20 },
    { name: "茅箭区", health: 154 },
    { name: "郧阳区", health: 89 },
    { name: "丹江口市", health: 69 },
    { name: "郧西县", health: 44 },
    { name: "竹山县", health: 40 },
    { name: "房县", health: 34 },
    { name: "竹溪县", health: 67 },

    { name: "襄州区", health: 20 },
    { name: "襄城区", health: 154 },
    { name: "樊城区", health: 89 },
    { name: "南漳县", health: 69 },
    { name: "保康县", health: 44 },
    { name: "谷城县", health: 40 },
    { name: "枣阳市", health: 34 },
    { name: "宜城市", health: 67 },
    { name: "老河口市", health: 67 },


  ]
  }
})
//根据地区获取码值
Mock.mock('http://127.0.0.1:8081/civilcode/selectCodeByName','get',()=>{
  return {
    code:200,
    data:[
      {
        name:'十堰市',
        code:'420300',
      }
    ]
  }
})


export default Mock;